<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/dsb.css">
</head>

<body>

{% include 'nav.html' %}

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class="{% block pub_active %}active{% endblock %}"><a href="{% url 'publisher' %}">出版社列表 </a></li>
                <li class="{% block book_active %}{% endblock %}"><a href="{% url 'book' %}">书籍列表 </a></li>
                <li class="{% block author_active %}{% endblock %}"><a href="{% url 'author' %}">作者列表</a></li>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            {% block main %}
                <h2 class="sub-header">出版社列表</h2>
                <a class="btn btn-primary btn-sm" href="/publisher_add/">新增</a>
                <div class="table-responsive">
                    <table class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>id</th>
                            <th>出版社名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for i in all_publishers %}
                            <tr>
                                <td>{{ forloop.counter }}</td>
                                <td>{{ i.id }}</td>
                                <td>{{ i.name }}</td>
                                <td>
                                    <a class="btn btn-danger btn-sm" href="{% url 'del' 'publisher' i.pk %}">删除</a>
                                    <a class="btn btn-primary btn-sm" href="/publisher_edit/?pk={{ i.id }}">编辑</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            {% endblock %}
        </div>
    </div>
</div>
</div>

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/limonte-sweetalert2/10.12.5/sweetalert2.all.js"></script>

<script>
    Swal.fire(
        'Good job!',
        'You clicked the button!',
        'success'
    )
</script>

</body>

</html>